package com.sfzd5.exam.helplibrary.taskstatisitcs;

public class StuInfo{
    public long id;
    public String name;
    public int overCount;
    public int rightCount;
    public int otherCount;

    Grade getGradeByOver(){
        if(rightCount==overCount)
            return Grade.满分;
        else if(rightCount/(float)overCount>0.85)
            return Grade.优秀;
        else if(rightCount/(float)overCount>0.6)
            return Grade.及格;
        else
            return Grade.不及格;
    }

    public float getRightRate(){
        if(overCount>0)
            return rightCount/(float)overCount;
        else
            return 0;
    }

    Grade getGrade(int questionCount){
        if(rightCount==questionCount)
            return Grade.满分;
        else if(rightCount/(float)questionCount>0.85)
            return Grade.优秀;
        else if(rightCount/(float)questionCount>0.6)
            return Grade.及格;
        else
            return Grade.不及格;
    }
}